
import {
    postSelectSession,postSelectRoom } from "../../api/userinfo";
  const room = {
      state: {
        roomInfo: {
        }, //房间信息
        sessionInfo: {
        }, //时间段信息
      },
    
      mutations: {
        SET_SESSION(state: any, value: any) {
            state.sessionInfo = value;
          },
        SET_ROOM(state: any, value: any) {
            state.roomInfo = value;
          }
      },
      actions: {
        SET_SESSION(content:any){
            return new Promise(async resolve=>{
                  await postSelectSession().then((res)=>{
                  content.commit("SET_SESSION",res.data)
                  resolve(resolve)
            })
            })
          },
        SET_ROOM(content:any){
            return new Promise(async resolve=>{
                await postSelectRoom().then((res)=>{
                content.commit("SET_ROOM",res.data)
                resolve(resolve)
          })
          })
        }
      },
    };
    
    export default room;